package com.pactera.madp.cp.mapper.crm;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.pactera.madp.cp.api.dto.crm.CrmCustomQueryConditionDTO;
import com.pactera.madp.cp.api.entity.crm.WorkCustomInfoEntity;
import com.pactera.madp.cp.api.vo.AddCustomerVO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * @author zkd
 * @date 2022/5/5 10:55
 */
@Mapper
public interface WorkCustomInfoMapper extends BaseMapper<WorkCustomInfoEntity> {

    List<WorkCustomInfoEntity> list(@Param("tableName") String tableName);

    boolean removeAll(@Param("tableName") String tableName);

    boolean batchSaveOrUpdate(@Param("tableName") String tableName, @Param("entityList") List<WorkCustomInfoEntity> entityList);

    List<WorkCustomInfoEntity> listByCondition(@Param("tableName") String tableName, @Param("queryCondition") CrmCustomQueryConditionDTO queryCondition);

    Integer countInCustMgrNoAndMobile(@Param("tableName") String tableName,@Param("custMgrNos") List<String> custMgrNos,@Param("mobiles") List<String> mobiles);

    Integer countInOrgCodes(@Param("tableName") String tableName, @Param("orgCodes") List<String> orgCodes);

    Integer countInOrgCodesAndMgrNos(@Param("tableName") String tableName, @Param("orgCodes") List<String> orgCodes, @Param("wxUserIds") List<String> wxUserIds);

    Integer countInMobiles(@Param("tableName") String tableName, @Param("mobiles") List<String> mobiles);

    Map<String,String> getCustNameAndAssetsLevelByMobile(@Param("tableName") String tableName, @Param("mobile") String mobile);

    List<Map<String,String>> getCustNameAndAssetsLevelByMobileNew(@Param("mobiles") List<String> mobiles);

    Page<AddCustomerVO> getAddCustomerVOPage(Page page,@Param("state") String state,@Param("wxUserIds") List<String> wxUserIds);

    List<AddCustomerVO> getAddCustomerVOListByCustMgrNo(@Param("custMgrNo") String custMgrNo,@Param("wxUserIds") List<String> wxUserIds);

    List<AddCustomerVO> getAddCustomerVOListByCustMgrNoNew(@Param("custMgrNo") String custMgrNo,@Param("wxUserIds") List<String> wxUserIds);

    List<Map<String, Long>> count(@Param("wxUserIds") List<String> wxUserIds);

    List<Map<String, Long>> count1(@Param("wxUserIds") List<String> wxUserIds);

    List<Map<String, Long>> count2(@Param("wxUserIds") List<String> wxUserIds);

    List<Map<String, Long>> count3(@Param("wxUserIds") List<String> wxUserIds);

    List<AddCustomerVO> list0(@Param("wxUserIds") List<String> wxUserIds, @Param("tableName") String tableName, @Param("limitStart") Long limitStart, @Param("size") Long size);

    List<AddCustomerVO> list1(@Param("wxUserIds") List<String> wxUserIds, @Param("tableName") String tableName, @Param("limitStart") Long limitStart, @Param("size") Long size);

    List<AddCustomerVO> list2(@Param("wxUserIds") List<String> wxUserIds, @Param("tableName") String tableName, @Param("limitStart") Long limitStart, @Param("size") Long size);

    List<AddCustomerVO> list3(@Param("wxUserIds") List<String> wxUserIds, @Param("tableName") String tableName, @Param("limitStart") Long limitStart, @Param("size") Long size);

}
